import { getCurrentDate_util, usenowDate } from '../util/util';


var storage = window.localStorage;

/**
 * 
 * @param {*}ca表面质量formdata 
 * @returns 
 */
export function use_qgd_mx_initformdata() {
  //create_time,update_time 插入方法自动拼接 
  var initformdata = {
    id: { ifdb: true, bt: false, value: "", title: 'id', dataIndex: 'id', inputType: "none" },
    // bdxx_title: { ifdb: false, bt: false, value: "", title: '表单信息', dataIndex: 'bdxx_title', inputType: "title_item" },
    create_by: { ifdb: false, bt: false, value: storage.ygxm, title: '请购人', dataIndex: 'create_by', inputType: "none"},
    djh: { ifdb: false, bt: false, value: "", title: '单据编号', dataIndex: 'djh', inputType: "none",placeholder:"自动生成"},
    djrq: { ifdb: false, bt: false, value: getCurrentDate_util(1), title: '请购日期', dataIndex: 'djrq', inputType: "none"},
    bz: { ifdb: false, bt: false, value: "", title: '备注', dataIndex: 'bz', inputType: "none"},
    mxxx_title: { ifdb: false, bt: false, value: "", title: '明细信息', dataIndex: 'mxxx_title', inputType: "title_item" },
    ggxh: { ifdb: true, bt: false, value: "", title: '规格型号', dataIndex: 'ggxh', inputType: "select_item_new",
      datas_key:"datas_wl",
      popup_tansferarr: [
        { origin: "wlmc", target: "wlmc" },
        { origin: "wlbm", target: "wlbm" },
        { origin: "ywlbm", target: "ywlbm" },
        { origin: "ggxh", target: "ggxh" },
        { origin: "dw", target: "dw" },
        { origin: "bbh", target: "bbh" },
        { origin: "fj", target: "wltp" },
      ],
    },
    wlmc: { ifdb: true, bt: true, value: "", title: '物料名称', dataIndex: 'wlmc', inputType: "readonly"},
    wlbm: { ifdb: true, bt: true, value: "", title: '物料编码', dataIndex: 'wlbm', inputType: "none"},
    ywlbm: { ifdb: true, bt: false, value: "", title: '原物料编码', dataIndex: 'ywlbm', inputType: "none"},
    wltp: { ifdb: true, bt: false, value: "", title: '物料图片', dataIndex: 'wltp', inputType: "upload_item", 
      oneline: "true",lineheight:"5.6rem",disabled:true},
    dw: { ifdb: true, bt: false, value: "", title: '单位', dataIndex: 'dw', inputType: "readonly"},
    bbh: { ifdb: true, bt: false, value: "", title: '版本号', dataIndex: 'bbh', inputType: "none"},

    qgsl: { ifdb: true, bt: true, value: "", title: '请购数量', dataIndex: 'qgsl', inputType: "input_number_item"},
    bzsm: { ifdb: true, bt: false, value: "", title: '备注说明', dataIndex: 'bzsm', inputType: "input_text_item"},
  
  }
  return initformdata
}
/**
 * 
 * @param {*}报工单formdata 
 * @returns 
 */
export function use_bgd_mx_initformdata() {
  //create_time,update_time 插入方法自动拼接 
  var initformdata = {
    id: { ifdb: false, bt: false, value: "", title: 'id', dataIndex: 'id', inputType: "none" },
    bdxx_title: { ifdb: false, bt: false, value: "", title: '表单信息', dataIndex: 'bdxx_title', inputType: "title_item" },
    create_by: { ifdb: true, bt: false, value: storage.ygxm, title: '报工人', dataIndex: 'create_by', inputType: "readonly"},
    create_time: { ifdb: false, bt: false, value: usenowDate(), title: '创建日期', dataIndex: 'create_time', inputType: "none"},
    djh: { ifdb: true, bt: false, value: "", title: '单据号', dataIndex: 'djh', inputType: "readonly",placeholder: '单据号'},
    bgsj: { ifdb: false, bt: false, value: getCurrentDate_util(1), title: '报工日期', dataIndex: 'bgsj', inputType: "readonly"},
    sscj: { ifdb: true, bt: true, value: "", title: '所属车间', dataIndex: 'sscj',inputType: "select_item_new",
      datas_key: 'datas_cj',
      popup_tansferarr: [
        { origin: "label", target: "sscj" }
      ] },
    bz: { ifdb: true, bt: false, value: "", title: '备注', dataIndex: 'bz', inputType: "input_text_item"},
    mxxx_title: { ifdb: false, bt: false, value: "", title: '报工信息', dataIndex: 'mxxx_title', inputType: "title_item" },
    ggxh: { ifdb: true, bt: false, value: "", title: '规格型号', dataIndex: 'ggxh', inputType: "select_item_new",
      datas_key:"datas_wl",
      popup_tansferarr: [
        { origin: "wlmc", target: "wlmc" },
        { origin: "wlbm", target: "wlbm" },
        { origin: "ggxh", target: "ggxh" },
        { origin: "dw", target: "dw" },
        { origin: "bbh", target: "bbh" },
      ],
    },
    gx: { ifdb: true, bt: true, value: "", title: '工艺', dataIndex: 'gx', inputType: "select_item_new",
      datas_key: 'datas_gx',
      popup_tansferarr: [
        { origin: "label", target: "gx" }
      ]},
    wlmc: { ifdb: true, bt: true, value: "", title: '物料名称', dataIndex: 'wlmc', inputType: "readonly"},
    wlbm: { ifdb: true, bt: false, value: "", title: '成品物料编码', dataIndex: 'wlbm', inputType: "none"},
    dw: { ifdb: true, bt: false, value: "", title: '单位', dataIndex: 'dw', inputType: "none"},
    bbh: { ifdb: true, bt: false, value: "", title: '版本号', dataIndex: 'bbh', inputType: "none"},

    bgsl: { ifdb: true, bt: true, value: "", title: '报工数量', dataIndex: 'bgsl', inputType: "input_number_item"},

    gylx: { ifdb: true, bt: false, value: "", title: '工艺类型', dataIndex: 'gylx', inputType: "none",
      datas_key: 'datas_gylx',
      popup_tansferarr: [
        { origin: "label", target: "gylx" }
      ]
    },
    
  
  }
  return initformdata
}


/**
 * 
 * @param {*}工票单formdata 
 * @returns 
 */
export function use_gpd_mx_initformdata() {
  //create_time,update_time 插入方法自动拼接 
  var initformdata = {
    id: { ifdb: true, bt: false, value: "", title: 'id', dataIndex: 'id', inputType: "none" },
    bdxx_title: { ifdb: false, bt: false, value: "", title: '表单信息', dataIndex: 'bdxx_title', inputType: "title_item" },
    create_by: { ifdb: false, bt: false, value: storage.ygxm, title: '请购人', dataIndex: 'create_by', inputType: "readonly" },
    create_time: { ifdb: false, bt: false, value: usenowDate(), title: '请购日期', dataIndex: 'create_time', inputType: "none" },
    sscj: {
      ifdb: true, bt: false, value: "", title: '所属车间', dataIndex: 'sscj', inputType: "select_item_new",
      datas_key: 'datas_cj',
      popup_tansferarr: [
        { origin: "label", target: "sscj" }
      ]
    },
    cjzr: {
      ifdb: true, bt: false, value: "", title: '车间主任', dataIndex: 'cjzr', inputType: "select_item_new",
      datas_key: 'datas_ry',
      popup_tansferarr: [
        { origin: "label", target: "cjzr" }
      ],
    },
    scr: {
      ifdb: true, bt: false, value: storage.ygxm, title: '生产人', dataIndex: 'scr', inputType: "select_item_new",
      datas_key: 'datas_ry',
      popup_tansferarr: [
        { origin: "label", target: "scr" }
      ],
    },
    scrq: { ifdb: true, bt: false, value: usenowDate(), title: '生产日期', dataIndex: 'scrq', inputType: "date_item" },
    mxxx_title: { ifdb: false, bt: false, value: "", title: '明细信息', dataIndex: 'mxxx_title', inputType: "title_item" },
    ggxh: {
      ifdb: true, bt: false, value: "", title: '规格型号', dataIndex: 'ggxh', inputType: "select_item_new",
      datas_key: "datas_wl",
      popup_tansferarr: [
        { origin: "wlmc", target: "wlmc" },
        { origin: "wlbm", target: "wlbm" },
        { origin: "ggxh", target: "ggxh" },
      ],
    },
    wlmc: { ifdb: true, bt: true, value: "", title: '物料名称', dataIndex: 'wlmc', inputType: "readonly" },
    wlbm: { ifdb: true, bt: true, value: "", title: '物料编码', dataIndex: 'wlbm', inputType: "none" },
    gx: { ifdb: true, bt: true, value: "", title: '工序', dataIndex: 'gx', inputType: "select_item_new",
      datas_key: 'datas_gx',
      popup_tansferarr: [
        { origin: "label", target: "gx" }
      ]},
    wgsl: { ifdb: true, bt: false, value: "", title: '完工数量', dataIndex: 'wgsl', inputType: "input_number_item" },
    wggs: { ifdb: true, bt: false, value: "", title: '完工工时', dataIndex: 'wggs', inputType: "input_number_item" },
    dj: { ifdb: true, bt: false, value: "", title: '单价', dataIndex: 'dj', inputType: "input_number_item" },
    xj: { ifdb: true, bt: false, value: "", title: '小计', dataIndex: 'xj', inputType: "input_item" },
    bz: { ifdb: true, bt: false, value: "", title: '备注', dataIndex: 'bz', inputType: "input_text_item" },

  }
  return initformdata
}
